<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<script type="text/javascript" src="../public/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../public/lib/jquery/1.9.1/jquery.min.js"></script>
<#include "lib/lib.html" />
<title>修改广告</title>
</head>
<body>
<div class="pd-20">
	<form action="${basePath}/advertis/updateAdv.do" method="post"  class="form form-horizontal" id="form-area-add" enctype="multipart/form-data">
		<input type="hidden" class="input-text" id="id" value="${info.id!}" name="id">
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>广告名称：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" id="advertName" value="${info.advertName!}" name="advertName">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>广告位置：</label>
			<div class="formControls col-5"> <span class="select-box" >
				<select class="select" id="advertPosition" name="advertPosition" nullmsg="请选择">
					<#if list?? && list?size gt 0>
						<#list list as dl >
							<option value="${dl.dictName}" <#if info.advertPosition == dl.dictName>selected="selected"</#if>>${dl.dictValue}</option>
						</#list>
					</#if>
				</select>
			</span> 
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">展示图片：</label>
			<div class="formControls col-5">
				  <span class="btn-upload">
				  	<a href="javascript:void();" class="btn btn-primary radius"><i class="iconfont">&#xf0020;</i> 浏览文件</a>
				 	<input type="file" id="fileImage" value="null" name="file" class="input-file" accept="image/png,image/jpg,image/jpeg,imge/bmp,image/gif">
				 </span>
				 <img alt="" src="${info.advertImage!}" width="160" height="160">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">广告跳转链接地址：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" id="advertResourceUrl" value="${info.advertResourceUrl!}" name="advertResourceUrl">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">显示顺序：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" id="advertSeq" value="${info.advertSeq!}" name="advertSeq">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>状态：</label>
			<div class="formControls col-5">
				<div class="radio-box">
					<input name="advertState" type="radio" value="0" <#if info.advertState==0>checked</#if>>
					<label for="sex-1">正常</label>
				</div>
				<div class="radio-box">
					<input name="advertState" type="radio" value="1" <#if info.advertState==1>checked</#if>>
					<label for="sex-1">下架</label>
				</div>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">描述：</label>
			<div class="formControls col-5">
				<textarea rows="8" cols="45" id="advertRemark" name="advertRemark">${info.advertRemark!}</textarea>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<button type="button" onclick="submitBtn()" class="btn btn-success radius" id="admin-role-save" name="admin-role-save">
						<i class="icon-ok"></i> 确定
				</button>
				<button type="button" onclick="layer_close()" class="btn btn-success radius" id="admin-role-close"
						name="admin-role-close">
						<i class="icon-ok"></i>取消
					</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
function submitBtn(){
	var advertName = $("#advertName").val();
	if(advertName == ""){
		layer.msg('广告名称不能为空', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	var advertPosition = $("#advertPosition").val();
	if(advertPosition == null || advertPosition == ""){
		layer.msg('请选择广告位置', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	$("#form-area-add").ajaxForm({
		success:function(data) {
			if(data == 200){
				layer.msg('添加成功!', {icon: 6,time:1000});
				window.parent.location.href="${basePath}/advertis/list.do";
			}else{
				layer.msg("系统异常", {icon: 5,time:1000});
			}
		},      
		dataType:"json"   
	}).submit(); 	
}
</script>
</body>
</html>